$(".J_documentCat").change(function() {
    var departmentid = $(this).val();
    window.location.href="/exercises/index?departmentid="+departmentid;
});